
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title><?php print $vn->getSiteName(); ?></title>

<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="author" content="Lateral Plains" />
<meta name="description" content="Lateral Plains Control Panel" />
<?php foreach($headers as $line){ print $line."\r\n";	} ?>

</head>

<body>
<!-- wrap starts here -->
<div id="wrap">

	<!--header -->
	<div id="header">			
				
		<h1 id="logo-text"><a href="<?php print $vn->getSiteLocation(); ?>" title=""><?php print $vn->getSiteName(); ?></a></h1>		
		<p id="slogan"><?php print $vn->getSiteSlogan(); ?></p>		
		<?php if($_SESSION['uData']['ulevel'] >= $vn->permissions['Administrator']){ ?>	
		<form id="quick-search" action="index.html" method="get" >
			<p>
			<label for="qsearch">Search:</label>
			<input class="tbox" id="qsearch" type="text" name="qsearch" value="Search..." title="Start typing and hit ENTER" />
			<input class="btn" alt="Search" type="image" name="searchsubmit" title="Search" src="<?php print $vn->getSiteLocation(); ?>/template/<?php print $vn->getTemplate(); ?>/images/search.gif" />
			</p>
		</form>	
		<?php }?>
			
	<!--header ends-->					
	</div>
		
	<!-- navigation starts-->
	<!-- main menu -->
	<div  id="nav">
		<ul>
			<?php 
			foreach($mainMenu as $key => $value){
				if($page==$key || !isset($page)){
					if($_SESSION['uData']['ulevel'] >= $value['permission']){
						print "<li id='current'><a href='".$vn->getSiteLocation()."/".$key."'>".$value['text']."</a></li>";
					}
				}else{
					if($_SESSION['uData']['ulevel'] >= $value['permission']){
						print "<li><a href='".$vn->getSiteLocation()."/".$key."'>".$value['text']."</a></li>";
					}
				}
			}
			?>
		</ul>
	<!-- navigation ends-->	
	</div>					
			
	<!-- content-wrap starts -->
	<div id="content-wrap">

<?php
//print $page." ";print_r($parsed);
if(!$session->loggedIn()){ ?>
			<form id="login" action="/login" method="post">			
			<p>	
				<label>Username</label>
				<input name="username" type="text" size="25" />

				<label>Password</label>
				<input name="password" type="password" size="25" />
				
<?php 	if(isset($_SESSION['error']['login'])){ ?>				
				<br/>
				<i id='error'><?php print $_SESSION['error']['login']; ?></i>
<?php 		unset($_SESSION['error']);
		} ?>			
				<br/><br/>
			
				<input style="padding: 0 15px; font-size:14px;" class="button" name="loginAuth" type="submit" value="Login"/>
			</p>		
			</form>	
<?php } ?>	

<?php
	if($_SESSION['uData']['ulevel'] >= $vn->permissions['Guest']){

		$vn->loadPage($page, $parsed);
		
	}
?>
		
	<!-- content-wrap ends-->	
	</div>
		
	<!-- footer starts -->		
	<div id="footer-wrap"><div id="footer-content">
	
		<div id="footer-bottom">
			<p>
			&copy; 2010 <strong><?php print $vn->getSiteName(); ?></strong> &nbsp;&nbsp;&nbsp;&nbsp;
			<a href="http://www.bluewebtemplates.com/" title="Website Templates">website templates</a> by <a href="http://www.styleshout.com/">styleshout</a> |
			Valid <a href="http://validator.w3.org/check?uri=referer">XHTML</a> | 
			<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>
			
   		    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			
			<a href="">Home</a>&nbsp;|&nbsp;
   		    <a href="">Sitemap</a>&nbsp;|&nbsp;
	   	    <a href="">RSS Feed</a>
   		    </p>
		</div>	

<!-- footer ends-->
</div></div>

<!-- wrap ends here -->
</div>

</body>
</html>
